home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / flst200.zip / V7P_SRC.ZIP / VERSION7.H < prev   
C/C++ Source or Header  |  1997-06-09  |  5KB  |  127 lines

  1. #if !defined _VERSION7_H_INCLUDED_
  2. #define _VERSION7_H_INCLUDED_
  3.  
  4. // return codes ============================================================
  5.  
  6. #define V7_ERROR                      (-1)
  7. #define V7_SUCCESS                    0 
  8. #define V7_IDX_OPENFAILED             1
  9. #define V7_IDX_SEEKERROR              2
  10. #define V7_IDX_READERROR              3
  11. #define V7_DTP_OPENFAILED             4
  12. #define V7_DTP_SEEKERROR              5
  13. #define V7_DTP_READERROR              6
  14. #define V7_DAT_OPENFAILED             7
  15. #define V7_DAT_SEEKERROR              8
  16. #define V7_DAT_READERROR              9
  17. #define V7_NODENUMBER_NOTFOUND        10
  18. #define V7_SYSOPNAME_NOTFOUND         11
  19. #define V7_FINDNEXT_END               12
  20. #define V7_OUT_OF_MEMORY              13
  21.  
  22.  
  23. #ifndef _WIN32
  24. #ifndef WORD_DEFINED
  25. #define WORD_DEFINED                
  26. typedef short WORD;
  27. typedef unsigned short UWORD;
  28. #endif                      
  29. #endif
  30.  
  31. // structure of a fido net node.  this structure is based primarily
  32. // on the NEWNODE structure of Opus CBCS
  33.  
  34. typedef struct {
  35.     WORD    ZoneNumber;
  36.     WORD    NetNumber;
  37.     WORD    NodeNumber;
  38.     UWORD   Cost;               // cost to user for message
  39.     char    SysopName[26];      // sysop
  40.     char    SystemName[34];     // node name
  41.     char    PhoneNumber[40];    // phone number
  42.     char    MiscInfo[30];       // city and state
  43.     char    Password[9];        // password, null-terminated
  44.     UWORD   RealCost;           // phone company's charge
  45.     short   HubNode;            // node # of this node's hub
  46.                                 // or point number if system is a point
  47.     UWORD   BaudRate;           // baud rate divided by 300
  48.     BYTE    ModemType;          // modem type
  49.     UWORD   NodeFlags;          // set of flags (see below)
  50.     ULONG   ulOffset ;          // offset into DAT file
  51.     short   online_start,       // V7+: ,U,Txy online flags as "minute of
  52.             online_end;         // the day" - see FSC-0062 v3
  53.                                 // only used if not CM
  54.     char    rawSysopName[26];   // V7+: raw sysop name
  55.     char    rawSystemName[34];  // V7+: raw system name
  56.     char    rawMiscInfo[30];    // V7+: raw city and state
  57.     char    rawType[10];        // V7+: raw: Zone,Region,Host,Hub,Pvt,...
  58.     char    rawFlags[64];       // V7+: raw: Flags
  59. } V7NODE, *PV7NODE ;
  60.  
  61. typedef struct _v7nodel{
  62.    V7NODE v7n;
  63.    struct _v7nodel *next;
  64. } V7NODEL, *PV7NODEL;
  65.  
  66. // Values for the `NodeFlags' field ========================================
  67.  
  68. #define B_hub    0x0001  // system is a net hub     
  69. #define B_host   0x0002  // system is a net host    
  70. #define B_region 0x0004  // system is region coord  
  71. #define B_zone   0x0008  // system is a zone gateway     
  72. #define B_CM     0x0010  // system runs continuous mail  
  73. #define B_res1   0x0020  // reserved by Opus      
  74. #define B_res2   0x0040  // reserved by Opus      
  75. #define B_res3   0x0080  // reserved by Opus      
  76. #define B_res4   0x0100  // reserved by Opus      
  77. #define B_res5   0x0200  // reserved for non-Opus 
  78. #define B_res6   0x0400  // reserved for non-Opus 
  79. #define B_res7   0x0800  // reserved for non-Opus 
  80. #define B_point  0x1000  // system is a point       
  81. #define B_res9   0x2000  // reserved for non-Opus 
  82. #define B_resa   0x4000  // reserved for non-Opus 
  83. #define B_resb   0x8000  // reserved for non-Opus 
  84.  
  85. // Values for the `miscflags' field ========================================
  86.  
  87. #define MF_v7plus   0x0003 /* =0 -> version7, =1 -> version7+ =2,3 -> rsrvd */
  88. #define MF_sysopndx 0x0004 /* =0 -> nodex.sdx, =1 -> sysop.ndx              */
  89.  
  90. // Values for the `whichindex' field =======================================
  91.  
  92. #define WI_ndx      1      /* node index */
  93. #define WI_sdx      2      /* sysop index */
  94. #define WI_pdx      3      /* phone index */
  95.  
  96. // V7Nl request control block ==============================================
  97.  
  98. typedef struct {
  99.     PSZ     pszPath;            /* path of nodelist files ("c:\nodelist\") */
  100.     PSZ     pszName;            /* name of data/index/dtp files, e.g. "nodex" */
  101.     UWORD   whichindex;         /* which index to use */
  102.     UWORD   miscflags;          /* misc flags */
  103.     PV7NODE pV7Node ;           /* address of where to copy nodelist record */  
  104.     WORD    wLen ;              /* length for find first node function
  105.                                    2 = search on Zone
  106.                                    4 = search on Zone + Net
  107.                                    6 = search on Zone + Net + Node
  108.                                    8 = search on Zone + Net + Node + Point
  109.                                 */
  110.     UWORD   V7Flags ;           /* Flags */                    
  111.     PVOID   pnlFh ;             /* used by find first/next */
  112. } V7RCB, *PV7RCB ;
  113.  
  114. // Function prototypes =====================================================
  115.  
  116. int V7Initialize(void);  // call this prior to any other V7* functions!
  117. int V7Finish(void);      // call this when you're finished with V7* functions
  118.  
  119. int V7FindFirst(PV7RCB); // finds all and returns first match
  120. int V7FindNext(PV7RCB);  // returns subsequent matches
  121. int V7FindClose(PV7RCB); // finishes find first/next processing
  122.  
  123. int  V7Find(PV7RCB);     // find a single match
  124.  
  125. #endif
  126.  
  127.